package com.example.lib.muchthread;

/**
 * 练习：创建两个线程，和主线程交替运行。
 */

public class b_ThreadTest_130 {

    public static void main(String[] args) {
        Test130 thread1=new Test130("one");
        Test130 thread2=new Test130("two");
        thread1.start();
        thread2.start();
//        thread1.run();
//        thread2.run();
        for (int i = 0; i < 60; i++) {
            System.out.println("main----"+i);
        }
    }
}

class Test130 extends Thread{
    private String name;

    public Test130(String name) {
        this.name = name;
    }

    @Override
    public void run() {
        for (int i = 0; i < 60; i++) {
            System.out.println(name+" Test run---"+i);
        }
    }
}
